import React from 'react'
import { Navigate } from 'react-router-dom'
function Hoc_login(Com:any) {
    return (props:any)=>{
        let token = localStorage.getItem('token')
        if(token)
        {
            
            return <Com {...props}></Com>
        }
        else
        {
            return <Navigate to='/login'></Navigate>
        }
        
        
    }
}

export default Hoc_login
